package com.alipay.traditionalbus;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * Created by crazytime on 14-3-1.
 */
public class EventBus {

    private int DEFAULT_CAP=100000;
    private BlockingQueue<Long[]> queue=new LinkedBlockingQueue<Long[]>(10000);

    public EventBus(){

    }
    public EventBus(int capacity){
        queue=new LinkedBlockingQueue<Long[]>(capacity);
    }

    public void postEvent(Long[] array) throws InterruptedException {
        queue.put(array);
    }

    public Long[] getEvent() {
        return queue.poll();
    }

    public boolean isEmpty(){
        return queue.isEmpty();
    }





}
